package com.qf.day61.service.impl;

import com.qf.day61.dao.BrandDAO;
import com.qf.day61.entity.Brand;
import com.qf.day61.service.BrandService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandServiceImpl implements BrandService {
    private final BrandDAO brandDAO;

    public BrandServiceImpl(BrandDAO brandDAO) {
        this.brandDAO = brandDAO;
    }

    @Override
    public Brand findById(Integer brandId) {
        return brandDAO.findById(brandId);
    }

    @Override
    public List<Brand> findAllByCategoryId(Integer categoryId) {
        return brandDAO.findAllByCategoryId(categoryId);
    }
}
